package ch.webkito.servlet;

import java.io.IOException;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import ch.webkito.i18n.I18n;
import ch.webkito.template.Partial;
import ch.webkito.template.Partials;
import ch.webkito.template.Template;

@I18n({"i18n"})
@Template("template")
@Partials(@Partial(name="header", partial="apartial"))
@ServletConfiguration(	urlMappings = {"/home"},
						urlMappingsRegex = {"/home/\\d+"},
						initParams = {@InitParam(name="name", value="value")})
public class WebkitoServletImpl extends WebkitoServlet {
	private static final long serialVersionUID = 1L;
	public void callRenderHtml(HttpServletRequest request, HttpServletResponse response)
	 throws IOException {
		renderHtml(request, response);
	}

	public void callRenderXml(HttpServletRequest request, HttpServletResponse response)
	 throws IOException {
		renderXml(request, response);
	}
	
	public void callRenderJson(HttpServletRequest request, HttpServletResponse response)
	 throws IOException {
		renderJson(request, response);
	}
	
	public void callRenderHtmlWithParameters(HttpServletRequest request, HttpServletResponse response, 
			Map<String, Object> params) throws IOException {
		renderHtml(request, response, params);
	}
}